<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>奖惩列表</title>
<script type="text/javascript" src="../boot.js"></script>
<script>
function parsePage(){
	
	$('#toolbar').toolbar({items:[{
		text:'添加奖惩',
		iconCls:'icon-add',
		handler:function(){
			add();
		}
	}]});
	
	toolSearch({
			items:[{"text":"会员账户","name":"key1"}],
			collapsible:false,
			callback:function(key,name){
					if(key==""){
						showInfo('请输入关键字');
						return;
					}
				showInfo(key);
			}
	});
	
	$('#tbList').datagrid({
		data:{"total":1,"rows":[{'id':1,'col1':'admin','col2':'金牌','col3':'--','col4':'加分','col5':'+5','col6':'1000','col7':'2013-07-15 18:12:30','col8':'system','col9':'--'}]},
		columns:[[{
			title:'会员账户',
			field:'col1',
			width:120,
			sortable:true
		},{
			title:'会员等级',
			field:'col2',
			width:120
		},{
			title:'会员类型',
			field:'col3',
			width:100
		},{
			title:'操作行为',
			field:'col4',
			width:100
		},{
			title:'积分',
			field:'col5',
			width:120
		},{
			title:'剩余积分',
			field:'col6',
			width:100,
			align:'right'
		},{
			title:'操作时间',
			field:'col7',
			width:150
		},{
			title:'操作者',
			field:'col8',
			width:100
		},{
			title:'操作备注',
			field:'col9',
			width:100
		}
		]]
	});
}

function add(){
	ygDialog({
	 title:'新增奖惩',
	 href:'reputation-jc-add.html',
	 width:500,
	 height:380,
	 buttons:[{
		text:'确认',
		handler:function(dialog){
			save(dialog);
		}
		},{
				text:'取消',
				handler:function(dialog){
					dialog.close();
				}
		}]
	});
}

function save(dialog){
	var myform=$('#myForm');
	myform.form({
		url:'form3_proc.php',
		onSubmit:function(){
			return $(this).form('validate');
		},
		success:function(data){
			showSuc('操作成功！');
			dialog.close();
		}
	});
	myform.submit();
}
</script>
</head>

<body class="easyui-layout">
<div data-options="region:'north',border:false" class="toolbar-region">
	<div id="toolbar"></div>
</div>
<div data-options="region:'center',border:false">
	<table id="tbList"></table>
</div>
</body>
</html>
